<script type="text/javascript">
	$(function() {
		//提交留言表单
		$("#commentPostForm").submit(function() {
			var data = $(this).serialize();
			jQuery.post("/Wyn/profile_tab/leave_mesage", data,function(){
				//留言发表成功后刷新好友留言tab
				var otherUserName = $("#otherUserNameHidden").val();
				var $comment = $("#comment");
				var d = {"otherUserName":otherUserName};
				//因为新增了留言，重现填充$("#comment")的内容
				jQuery.post("/Wyn/profile_tab/go_other_message",
							d,
							function(data){
								$comment.html(data).attr("isReady","true").show();;
							});
				$("#friendsGossipList").click();
			});
			return false;
		});
		//点击新鲜事链接
		$("#freshThingsA").click(function(){
			//改变新鲜事和留言链接的选中状态
			$(this).parent().addClass("c").addClass("selected");
			$("#friendsGossipList").parent().removeClass("c").removeClass("selected");
			//隐藏留言tab
			$("#comment").hide();
			
			if("true" == $("#miniFeed").attr("isReady")){
				$("#miniFeed").show();//已经加载过数据直接显示
			}else{
				//加载新鲜事
				var otherUserName = $(this).attr("otherUserName");
				var d = {"otherUserName":otherUserName};
				jQuery.post("/Wyn/profile_tab/go_other_fresh_things",
					d,
					function(data){
						//第一次加载数据后isReady置为"true"
						$("#miniFeed").html(data).attr("isReady","true").show();;
					});
			}
		});	
		//点击留言链接
		$("#friendsGossipList").click(function(){
			//改变新鲜事和留言链接的选中状态
			$(this).parent().addClass("c").addClass("selected");
			$("#freshThingsA").parent().removeClass("c").removeClass("selected");
			$("#miniFeed").hide();//隐藏新鲜事tab
			var $comment = $("#comment");
			if("true" == $comment.attr("isReady")){
				$comment.show();
			}else{
				//加载留言
				var otherUserName = $(this).attr("otherUserName");
				var d = {"otherUserName":otherUserName};
				jQuery.post("/Wyn/profile_tab/go_other_message",
							d,
							function(data){
								//第一次加载数据后isReady置为"true"
								$comment.html(data).attr("isReady","true").show();;
							});
			}
		});	
		//默认是查看新鲜事
		$("#freshThingsA").click();
	});
</script>
<div id="ajaxContainer" class="cols clearfix">
	<#--隐藏域表明查看的那个用户的页面-->
	<input type="hidden" id="otherUserNameHidden" value="${otherUd.userName}">
	<div class="col-center">
		<div class="main-content">
			<div id="comWall" class="com-wall">
				<div id="comfirm_diag"
					class="generic_dialog wallpro_dialog pop_dialog" style=""></div>
				<div class="box-holder talk-box">

					<div class="box" id="gossipBoard" stats="n2_gossipboard">
						<h4 class="box-header">
							<span><a href="javascript:;" class="title"
								stats="n2_gossipboard">留言板</a> <a
								href="http://gossip.renren.com/getgossiplist.do?id=226049202&amp;age=recent"
								class="count"></a> </span> <small> <a stats="pf_allgossip"
								href="http://gossip.renren.com/getgossiplist.do?id=226049202&amp;age=recent">所有留言</a>
							</small>
						</h4>
						<div class="box-body">
							<div class="m-editor" id="miniEditor">

								<form id="commentPostForm">
									<div class="m-editor-textarea">
										<textarea id="cmtbody" tabindex="2" name="messageBody"
											rows="4" cols="60" style="color: rgb(136, 136, 136);">
										</textarea>
									</div>
									<div class="m-editor-submit">
										<input stats="pf_subgossip" type="submit" id="commentPostBtn"
											value="&nbsp;留言&nbsp;" class="input-button"> <input
											type="hidden" value="${otherUd.userName}"
											name="otherUserName">
									</div>
								</form>
							</div>
						</div>
					</div>

					<div class="nav-tabs">
						<ul class="tabs clearfix">
							<li>
								<a id="freshThingsA" stats="pf_freshsfeed" href="#nogo" otherUserName="${otherUd.userName}">${otherUd.realName}的新鲜事</a>
							</li>
							<li>
								<a id="friendsGossipList" stats="pf_gossip" href="#nogo" otherUserName="${otherUd.userName}">好友留言</a>
							</li>
						</ul>
					</div>
					<div id="miniFeed" isReady=""></div>
					<div id="comment" isReady="" class="comment-holder">
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-right">
		<div class="extra-side">
			<div id="visitors" class="mod">
				<div class="mod-header">
					<div class="mod-header-in">
						<h4>最近来访</h4>
						<span class="count">(1069)</span>
					</div>
				</div>
				<div class="mod-body-out">
					<div class="mod-body">
						<ul class="people-list">
							<li><a stats="pf_recent" class="avatar" namecard="278271144"
								href="http://www.renren.com/profile.do?portal=profileFootprint&amp;ref=profile_footprint&amp;id=278271144"
								title="查看吴明的个人主页"> <img stats="pf_recent"
									src="http://hdn.xnimg.cn/photos/hdn221/20120205/2100/tiny_PwXT_383917m019118.jpg"
									width="50">
							</a>

								<div class="people-detail">
									<center style="*text-align: left">
										<img style="cursor: pointer;"
											src="http://a.xnimg.cn/imgpro/icons/online_1.gif"
											title="点此和吴明聊天"> <a stats="pf_recent"
											namecard="278271144" title="吴明"
											href="http://www.renren.com/profile.do?portal=profileFootprint&amp;ref=profile_footprint&amp;id=278271144">吴明</a>
									</center>
								</div></li>
						</ul>
					</div>
				</div>
			</div>
			<div id="friends" class="mod">
				<div class="mod-header">
					<div class="mod-header-in">
						<a stats="pf_allfriend"
							href="http://friend.renren.com/GetFriendList.do?id=226049202"
							class="more">查看全部</a>
						<h4>他的好友</h4>
						<a stats="pf_allfriend"
							href="http://friend.renren.com/GetFriendList.do?id=226049202"
							class="count">(190)</a>
					</div>
				</div>
				<div class="mod-body-out">
					<div class="mod-body">
						<p class="inviteguys">
							<a stats="pf_introduce" href="#nogo"
								onclick="showRecommendedFriendDialog('226049202','吴滔')"><img
								src="http://a.xnimg.cn/a.gif" class="icons16 icon-addguy">推荐好友给他</a>
						</p>
						<ul class="people-list">
							<li><a stats="pf_friend" class="avatar"
								href="http://www.renren.com/profile.do?portal=profileFriendlist&amp;id=229742852"
								title="查看肖斐鸿的个人主页"> <img stats="pf_friend"
									src="http://hdn.xnimg.cn/photos/hdn221/20100730/1050/tiny_EJPW_118923l019117.jpg"
									width="50">
							</a>
								<div class="people-detail">
									<center>
										<a stats="pf_friend" class="lively-user"
											title="肖斐鸿 连续登陆7天, 即可获得橙名特权"
											href="http://www.renren.com/profile.do?portal=profileFriendlist&amp;id=229742852">肖斐鸿</a>
									</center>
								</div></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="flash-content"></div>
</div>